package com.thx.dictionary.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thx.common.datasource.DataSource;
import com.thx.common.service.BaseManager;
import com.thx.dictionary.dao.DictionaryValueDao;
import com.thx.dictionary.model.DictionaryValue;


@Service
@DataSource("dataSourceB")
@Transactional(readOnly = true)
public class DictionaryValueManager extends BaseManager<DictionaryValue> {
	@Autowired
	private DictionaryValueDao dicvDao;
	
	 public List<DictionaryValue> findByDicnCode(String dicnCode){
	    	return dicvDao.findByDicnCode(dicnCode);
	    }
	 public DictionaryValue findByValueAndDicCode(String value , String dicnCode){
	    	return dicvDao.findByValueAndDicCode(value,dicnCode);
	    }
	 /**
	  * 分页获取DictionaryValue的集合
	  * @param id        字典值id
	  * @param text		  字典值名称
	  * @param dicnCode  字典的code
	  * @return
	  */
	 public List<DictionaryValue> findByIDTAndDicCode(String id ,String text , String dicnCode){
	    	return dicvDao.findByIDTAndDicCode(id,text,dicnCode);
	 }
	 public List<DictionaryValue> findByDicnId(String dicnId){
		 return dicvDao.findByDicnId(dicnId);
	 }
}
